package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.RelyPoJo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/11/1 10:50
 * @desrcption: 联动其他表单获取数据
 */
@Getter
@Setter
@ToString
public class LinkRelyDataDTO extends BaseDTO {

    private static final long serialVersionUID = -7037875964913997046L;

    /**
     * 应用id
     */
    private Long appId;

    /**
     * 菜单id
     */
    private Long menuId;
    /**
     * 表单id
     */
    private Long formId;

    /**
     * 字段标识
     */
    @NotNull(message = "{dto.msg.linkFormData.attr.NotNull}")
    private String attr;
    /**
     * 子表单标识
     */
    private String subAttr;

    /**
     * 数据联动的属性
     */
    @Valid
    private RelyPoJo rely;

    /**
     * displayField对应的值
     */
    private Object[] displayFieldValue;

    /**
     * @see com.xbongbong.pro.enums.SaasMarkEnum
     */
    private Integer saasMark;

    /**
     * @see com.xbongbong.saas.enums.XbbRefTypeEnum
     */
    private Integer businessType;

    /**
     * 模糊搜索的值
     */
    private Object value;

    /**
     * 预览字段列表
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<FieldAttrEntity> previewFieldList;
}
